
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Grebok.Common;
using Grebok.Common.Configuration;

namespace JieBooLaw.Persistence.Test.DataManager
{
    public class TInfoRelease_ItemManager : BaseManager
    {
        #region private field

        private static TInfoRelease_ItemManager manager;
        #endregion

        #region Properties
        
        public Int32? ItemID
        {
            get { return GetConfig<Int32?>("ItemID"); }
            set { SetConfig<Int32?>("ItemID", value); }
        }
        
        public Int32? PItemID
        {
            get { return GetConfig<Int32?>("PItemID"); }
            set { SetConfig<Int32?>("PItemID", value); }
        }
        
        public Int32? Level
        {
            get { return GetConfig<Int32?>("Level"); }
            set { SetConfig<Int32?>("Level", value); }
        }
        
        public String ItemName
        {
            get { return GetConfig<String>("ItemName"); }
            set { SetConfig<String>("ItemName", value); }
        }
        
        public String ItemDesc
        {
            get { return GetConfig<String>("ItemDesc"); }
            set { SetConfig<String>("ItemDesc", value); }
        }
        
        public Int32? ItemSort
        {
            get { return GetConfig<Int32?>("ItemSort"); }
            set { SetConfig<Int32?>("ItemSort", value); }
        }
        
        public String LinkURL
        {
            get { return GetConfig<String>("LinkURL"); }
            set { SetConfig<String>("LinkURL", value); }
        }
        
        public Boolean? Active
        {
            get { return GetConfig<Boolean?>("Active"); }
            set { SetConfig<Boolean?>("Active", value); }
        }
        

        #endregion

        #region Constructor

        /// <summary>
        /// TInfoRelease_ItemManager
        /// </summary>
        private TInfoRelease_ItemManager()
        {
            IApplicationConfiguration configuration = ApplicationConfigurationFactor.CreateApplicationConfiguration();
            appPropertiese = new ApplicationProperties(configuration[PropertiesConst.TINFORELEASE_ITEM_PROPERTIES_FILE_NAME_KEY],
                configuration[PropertiesConst.TINFORELEASE_ITEM_PROPERTIES_SECTION_NAME_KEY]);

            appPropertieseValues = new Dictionary<string, object>();
        }
        #endregion

        #region TInfoRelease_ItemManager Instance

        /// <summary>
        /// TInfoRelease_ItemManager's Instance
        /// </summary>
        public static TInfoRelease_ItemManager Instance
        {
            get
            {
                if (manager == null)
                {
                    manager = new TInfoRelease_ItemManager();
                }
                return manager;
            }
        }
        #endregion

    }
}
